package org.tmad.ocms.dao;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

import org.apache.log4j.Logger;
import org.tmad.ocms.log.LogFactory;
import org.tmad.ocms.model.Case;


public class CaseDetailsDAO {
	private static Logger logger = LogFactory.getLogger();
	Connection con = null;

	public boolean login(String username, String pwd) throws Exception {
		boolean result = false;

		con = ConnectionManager.getDbConnection();
		Statement stmt = con.createStatement();
		ResultSet results = stmt
				.executeQuery("select * from volunteer where username='" + username
						+ "' and password ='" + pwd + "'");	
		while (results.next()) {
			result = true;
		}
		return result;
	}
	public boolean casedetails(Case user) throws Exception {
		try{
		con = ConnectionManager.getDbConnection();
		Statement stmt = con
				.createStatement();
		ResultSet rs =stmt.executeQuery("select * from casereg ");
	
		while(rs.next()){
		 String casetype=rs.getString(9);
			String helpcategory=rs.getString(8);
			String summary=rs.getString(6);	
			String description=rs.getString(7);
			String needyname=rs.getString(2);
			String address=rs.getString(3);
			String mobile=rs.getString(14);
			String contactmail=rs.getString(15);
		}
		}
		catch(Exception e){
			e.printStackTrace();
		}
		return true;
	}
	

}
